<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
	*{
		padding: 0;
		margin: 0;
		font-family: 微软雅黑;
	}
	.tab{
		width: 316px;
		height: 360px;
		border: 4px solid green;
		margin: 10px auto;
		position: relative;
	}
	.tab .menu li{
		list-style: none;
		width: 79px;
		height: 30px;
		line-height: 30px;
		text-align: center;
		color: white;
		float: left;
	}
	.tab .con{
		width: 300px;
		height: 300px;
		position: absolute;
		top: 50px;
		left: 10px;
		display: none;
	}
	.tab .sanjiao{
		width: 79px;
		height: 7px;
		background: url(sanjiao.jpg) no-repeat;
		position: absolute;
		top: 33px;
		left: 0px;
	}
</style>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
	$(function(){
		
		// 给四个li都加鼠标移入事件
		$('.tab .menu li').mouseover(function(){
			// 获得当前移入的li的序号
			var cur = $(this).index();
			// 让cur号con元素显示，其他的隐藏
			$(this).parent().siblings('.con').eq(cur).show().siblings('.con').hide();

			// 计算小滑块的left值
			var left = cur*79;
			// 让小滑块移动过来

			$(this).parent().siblings('.sanjiao').stop().animate({'left':left+'px'}, 400);
		})


	})
</script>
</head>

<body>

<div class="tab">
	<ul class="menu">
		<li style="background:purple;">话费</li>
		<li style="background:green;">旅行</li>
		<li style="background:blue;">彩票</li>
		<li style="background:orange;">游戏</li>
	</ul>
	<div class="con" style="background:purple;display:block;"></div>
	<div class="con" style="background:green;"></div>
	<div class="con" style="background:blue;"></div>
	<div class="con" style="background:orange;"></div>

	<div class="sanjiao"></div>
</div>

<div class="tab">
	<ul class="menu">
		<li style="background:purple;">话费</li>
		<li style="background:green;">旅行</li>
		<li style="background:blue;">彩票</li>
		<li style="background:orange;">游戏</li>
	</ul>
	<div class="con" style="background:purple;display:block;"></div>
	<div class="con" style="background:green;"></div>
	<div class="con" style="background:blue;"></div>
	<div class="con" style="background:orange;"></div>

	<div class="sanjiao"></div>
</div>

<div class="tab">
	<ul class="menu">
		<li style="background:purple;">话费</li>
		<li style="background:green;">旅行</li>
		<li style="background:blue;">彩票</li>
		<li style="background:orange;">游戏</li>
	</ul>
	<div class="con" style="background:purple;display:block;"></div>
	<div class="con" style="background:green;"></div>
	<div class="con" style="background:blue;"></div>
	<div class="con" style="background:orange;"></div>

	<div class="sanjiao"></div>
</div>

<div class="tab">
	<ul class="menu">
		<li style="background:purple;">话费</li>
		<li style="background:green;">旅行</li>
		<li style="background:blue;">彩票</li>
		<li style="background:orange;">游戏</li>
	</ul>
	<div class="con" style="background:purple;display:block;"></div>
	<div class="con" style="background:green;"></div>
	<div class="con" style="background:blue;"></div>
	<div class="con" style="background:orange;"></div>

	<div class="sanjiao"></div>
</div>

<div class="tab">
	<ul class="menu">
		<li style="background:purple;">话费</li>
		<li style="background:green;">旅行</li>
		<li style="background:blue;">彩票</li>
		<li style="background:orange;">游戏</li>
	</ul>
	<div class="con" style="background:purple;display:block;"></div>
	<div class="con" style="background:green;"></div>
	<div class="con" style="background:blue;"></div>
	<div class="con" style="background:orange;"></div>

	<div class="sanjiao"></div>
</div>

<div class="tab">
	<ul class="menu">
		<li style="background:purple;">话费</li>
		<li style="background:green;">旅行</li>
		<li style="background:blue;">彩票</li>
		<li style="background:orange;">游戏</li>
	</ul>
	<div class="con" style="background:purple;display:block;"></div>
	<div class="con" style="background:green;"></div>
	<div class="con" style="background:blue;"></div>
	<div class="con" style="background:orange;"></div>

	<div class="sanjiao"></div>
</div>

<div class="tab">
	<ul class="menu">
		<li style="background:purple;">话费</li>
		<li style="background:green;">旅行</li>
		<li style="background:blue;">彩票</li>
		<li style="background:orange;">游戏</li>
	</ul>
	<div class="con" style="background:purple;display:block;"></div>
	<div class="con" style="background:green;"></div>
	<div class="con" style="background:blue;"></div>
	<div class="con" style="background:orange;"></div>

	<div class="sanjiao"></div>
</div>


</body>
</html>
